#! /bin/sh
. "${srcdir=.}/init.sh"; path_prepend_ . ../src

# Test JavaScript support: non-ASCII characters in XML tags or content.

printf '<a\340' > xg-js-8a.js
printf '<a></a\340' > xg-js-8b.js
printf '<a>\340</a>' > xg-js-8c.js

: ${XGETTEXT=xgettext}
LANGUAGE= LC_ALL=C ${XGETTEXT} --no-location -d xg-js-8.tmp xg-js-8a.js 2>xg-js-8.err
result=$?
cat xg-js-8.err
test $result = 1 || Exit 1
grep 'Non-ASCII' xg-js-8.err >/dev/null || Exit 1

: ${XGETTEXT=xgettext}
LANGUAGE= LC_ALL=C ${XGETTEXT} --no-location -d xg-js-8.tmp xg-js-8b.js 2>xg-js-8.err
result=$?
cat xg-js-8.err
test $result = 1 || Exit 1
grep 'Non-ASCII' xg-js-8.err >/dev/null || Exit 1

: ${XGETTEXT=xgettext}
LANGUAGE= LC_ALL=C ${XGETTEXT} --no-location -d xg-js-8.tmp xg-js-8c.js 2>xg-js-8.err
result=$?
cat xg-js-8.err
test $result = 1 || Exit 1
grep 'Non-ASCII' xg-js-8.err >/dev/null || Exit 1

exit 0
